home *** CD-ROM | disk | FTP | other *** search
- <html>
-
- <head>
- <LINK REL="stylesheet" TYPE="text/css" HREF="%1css/default.css">
- <SCRIPT LANGUAGE="JavaScript">
-
- // use for put in an empty option into the select, otherwise, deleted stuff will still be shown
- var emptyString = " ";
-
- function OnCancelAndExit()
- {
- window.parent.location = "%12";
- }
-
- function init()
- {
- // Remove the formatting options
- document.AddRemoveRights.targets.options[0] = null;
- document.AddRemoveRights.choices.options[0] = null;
-
- document.AddRemoveRights.uorgselect.selectedIndex = %2;
- }
-
-
- function changeCategory()
- {
- // Add Remove Groups
- if (document.AddRemoveRights.uorgselect.selectedIndex == 0)
- {
- window.location = "%3";
- }
- // Add Users
- if (document.AddRemoveRights.uorgselect.selectedIndex == 1)
- {
- window.location = "%4";
- }
- // Remove Users
- else if (document.AddRemoveRights.uorgselect.selectedIndex == 2)
- {
- window.location = "%5";
- }
- }
-
- function add(src,dest,flag)
- {
- //flag is going to be true or false
- //if flag is true, it is adding, otherwise, it is removing.
- //we need this, because, when adding, newHasExplicitRight is going to be true
- //when removing, newHasExplicitRight is going to be false
-
- var count = src.options.length;
-
- // anything to add?
- if ( count == 0)
- return;
-
- var selArr = new Array;
-
- var i = 0
- if (src.options[0].text == emptyString)
- i = 1;
-
- for (i; i < count; i++)
- {
- if (src.options[i].selected) selArr[selArr.length] = i;
- }
-
- if ( selArr.length == count ) {
- addAll(src,dest, flag);
- return;
- }
-
- for (var i = 0; i < selArr.length; i++)
- {
- index = selArr[i];
-
- current_target = src[index];
-
- option = new Option(current_target.text, current_target.value, false, false);
-
- // If we are adding to an empty list
- if (dest.options.length == 1)
- {
- if (dest.options[0].text == emptyString)
- {
- dest.options[0] = option;
- }
- else dest.options[dest.options.length] = option;
- }
- else dest.options[dest.options.length] = option;
- }
-
- for (var i = 0; i < selArr.length; i++)
- {
- src[selArr[i]-i] = null;
- }
-
- if (src.length == 0)
- {
- // if this is the last one, set emptystring
- src[0] = new Option(emptyString, 0, false, false);
- }
- }
-
- function addAll(src,dest,flag)
- {
- //flag is going to be true or false
- //if flag is true, it is adding, otherwise, it is removing.
- //we need this, because, when adding, newHasExplicitRight is going to be true
- //when removing, newHasExplicitRight is going to be false
-
- var count = src.options.length;
-
- // anything to add?
- if ( count == 0)
- return;
-
- var i = 0
- if (src.options[0].text == emptyString)
- i = 1;
-
- for (i; i < count; i++)
- {
- current_target = src[i];
-
- option = new Option(current_target.text, current_target.value, false, false);
-
- if (dest.options.length == 1)
- {
- if (dest.options[0].text == emptyString)
- dest.options[0] = option;
-
- else dest.options[dest.options.length] = option;
- }
- else dest.options[dest.options.length] = option;
- }
-
- src.options.length = 0;
- src[0] = new Option(emptyString, 0, false, false);
- }
-
- function OnSubmit()
- {
- added_final_value = "";
- added_first = true;
-
- // Just run though all the targets and assign the values
- for (count = 0; count < document.AddRemoveRights.targets.options.length; ++count)
- {
-
- temp = document.AddRemoveRights.targets.options[count];
-
- if (temp.value == 0)
- continue;
-
- // add right
- if (!added_first)
- added_final_value += "+";
- else
- added_first = false;
-
- added_final_value += temp.value;
- }
-
- // Build the string
- document.AddRemoveRights.Added.value = added_final_value;
-
- document.AddRemoveRights.submit();
- }
-
- </SCRIPT>
- </head>
-
- <BODY onload="init();">
-
-
- <FORM action="%6" target="_parent" method="post" name="AddRemoveRights" >
-
- <BR>
-
-
- <table CELLPADDING="2" CELLSPACING="2" border=0>
- <tr>
- <td class="list" width=10>
- <td class="list">
-
- Select Operation:
- <SELECT NAME="uorgselect" width=200 onChange="changeCategory()">
- <OPTION VALUE="groups"> Add/Remove Groups </OPTION>
- <OPTION VALUE="add_users"> Add Users </OPTION>
- <OPTION VALUE="rem_users"> Remove Users </OPTION>
- </SELECT>
- <td>
- <td class="list" width=20>
- <td class="list"> <strong> %7 </strong>
- </tr>
- </table>
-
- <BR>
-
- <center>
- <table CELLPADDING="2" CELLSPACING="2" border=0 width=100%>
- <tr>
- <td class="list" width=10> </td>
- <td class="list" align=left colspan=2>
- %8
- </td>
- <td class="list">
- %9
- </td>
- </tr>
-
- <tr>
- <td class="list" width=10> </td>
- <td class="list">
- <SELECT class="menuFormElement" multiple NAME="choices" SIZE=10 width=250>
- <OPTION> This is a formatting string </OPTION>
- %10
- </SELECT>
- </td>
-
- <td>
- <table border=0 cellpadding=0>
- <tr><td align=middle>
- <table align=center CELLPADDING="0" CELLSPACING="5" border=0>
- <tr><td class="clsButton" align=middle nowrap>
- <div class="clsButton"><a href="javascript:add(document.AddRemoveRights.choices, document.AddRemoveRights.targets, true)"> > </a></div>
- </td></tr>
- </table>
- </td></tr>
-
- <tr><td align=middle>
- <table align=center CELLPADDING="0" CELLSPACING="5" border=0>
- <tr><td class="clsButton" align=middle nowrap>
- <div class="clsButton"><a href="javascript:addAll(document.AddRemoveRights.choices, document.AddRemoveRights.targets, true)"> >> </a></div>
- </td></tr>
- </table>
- </td></tr>
-
- <tr><td>
- <table align=center CELLPADDING="0" CELLSPACING="5" border=0>
- <tr><td class="clsButton" align=middle nowrap>
- <div class="clsButton"><a href="javascript:add(document.AddRemoveRights.targets, document.AddRemoveRights.choices, false)"> < </a></div>
- </td></tr>
- </table>
- </td></tr>
- <tr><td align=middle>
- <table align=center CELLPADDING="0" CELLSPACING="5" border=0>
- <tr><td class="clsButton" align=middle nowrap>
- <div class="clsButton"><a href="javascript:addAll(document.AddRemoveRights.targets, document.AddRemoveRights.choices, false)"> << </a></div>
- </td></tr>
- </table>
- </td></tr>
- </table>
- </td>
-
- <td class="list">
- <SELECT class="menuFormElement" multiple NAME="targets" SIZE=10 width=250>
- <OPTION> This is a formatting string </OPTION>
- %11
- </SELECT>
- </td>
- </tr>
- </table>
-
- <BR>
-
- <table align=center cellpadding=0 border=0>
- <tr>
- <td class="clsButton" align=middle nowrap>
- <div class="clsButton"><a href="javascript:OnSubmit()">OK</a></div>
- </td>
-
- <td class="clsButton" align=middle nowrap>
- <div class="clsButton"><a href="javascript:OnCancelAndExit()">Cancel</a></div>
- </td>
- </tr>
- </table>
-
- </center>
-
- <input type=hidden name="Added" value = "">
-
- </FORM>
-
- </body>
- </html>
-